/* 
 * File:   Raytracer.h
 * Author: brady
 *
 * Created on June 23, 2011, 6:02 PM
 */

#ifndef RAYTRACER_H
#define	RAYTRACER_H

#include <dto/RenderParams.h>
#include <dto/ThreadParams.h>
#include <core/PixelDispenser.h>
#include <dto/IntersectionParams.h>
#include <dto/IntersectionResult.h>
#include <shapes/Shape.h>
#include <shaders/Shader.h>
#include <stdlib.h>
#include <cstdlib>
#include <pthread.h>
#include <vector>
#include <iostream>
using namespace std;

/**
 * Static class for rendering scenes
 */

class Raytracer {
public:
    Raytracer(){}
    static void render();
    
private:
    static void* renderThread(void* threadParams);
    static vector<Ray> generateRays(Pixel& pixel);
    static void colorPixel(const Pixel& pixel, const Vector3D& color);
};

static pthread_mutex_t PIXEL_DISPENSER_MUTEX = PTHREAD_MUTEX_INITIALIZER;
static const float M_PI = 3.14159;

#endif	/* RAYTRACER_H */

